package com.tangly.module.vo;

import com.tangly.module.entity.LoanRateEntity;
import com.tangly.module.entity.MessageLogEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;

/**
 * created by yehao on 2018/7/27.
 */
@Data
@ApiModel(description = "消息")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class AppMessageLogVO {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "JDBC")
    private long id;

    @Column(name = "create_time")
    private Date createTime;

    @Column(name = "update_time")
    private Date updateTime;

    @Column(name = "is_delete")
    @ApiModelProperty(value = "是否删除")
    private Boolean isDelete;

    @Column(name = "user_info_id")
    @ApiModelProperty(value = "发布用户")
    private long userInfoId;

    @ApiModelProperty(value = "类型")
    private String type;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "内容")
    private String content;

    @ApiModelProperty(value = "发布范围")
    private String ranges;

    @ApiModelProperty(value = "发送时间类型，立即定时")
    private String sendType;


    public static AppMessageLogVO convert(MessageLogEntity messageLogEntity){
        AppMessageLogVO vo=new AppMessageLogVO();
        BeanUtils.copyProperties(messageLogEntity,vo);
        return  vo;
    }
}
